/zs if($_SERVER["REDIRECT_URL"]=="") header("location: /zs"); // reklama $reklama=false; // vizualizace $vizualizace=true; $vizualizaceurl="/zs-vizualizace"; // nastaveni zapisu do 1. rocniku $zapisdoskoly=false; $zapisdoskolyurl="https://aplikace.zapisyonline.cz/SOL/PublicWeb/zscp/KWE015_Prihlaska.aspx?ID=4518"; $zapisdoskolyimg="img/mainPage/logo-zs-zapis.png"; // predem upravit obrazek !!! (/img/mainPage/logo-zs-zapis.png) // nastaveni zapisu do MS $zapisdoskolky=false; $zapisdoskolkyurl="https://aplikace.zapisyonline.cz/SOL/PublicWeb/zscp/KWE015_Prihlaska.aspx?ID=5144"; $zapisdoskolkyimg="img/mainPage/logo-zs-zapis-ms.png"; // predem upravit obrazek !!! (/img/mainPage/logo-zs-zapis.png) session_start(); if(preg_match("/-/",$_SERVER["REDIRECT_URL"])) { $_SESSION["MAINPAGE"]=substr($_SERVER["REDIRECT_URL"],1,strpos($_SERVER["REDIRECT_URL"],"-")-1); } else $_SESSION["MAINPAGE"]=substr($_SERVER["REDIRECT_URL"],1); if($_SESSION["MAINPAGE"]!="zs" and $_SESSION["MAINPAGE"]!="druzina" and $_SESSION["MAINPAGE"]!="ms" and $_SESSION["MAINPAGE"]!="babyklub" and $_SESSION["MAINPAGE"]!="anglictina") $_SESSION["MAINPAGE"]="zs"; $_SESSION["PAGE"]=substr($_SERVER["REDIRECT_URL"],1); // DB // include "inc/dibi.min.php"; include __DIR__."/inc/dibi.phar"; dibi::connect(array( 'driver' => 'mysqli', 'host' => 'localhost', 'username' => 'zscp.152', 'password' => 'K;E-w9;1Q', 'database' => 'zscp_152', 'charset' => 'utf8' )); // finder include __DIR__.'/inc/finder.php'; // ziskej ID z $_SESSION["MAINPAGE"] $mpID=dibi::fetch("select id from site_main_page where url=%s", $_SESSION["MAINPAGE"]); ?> zscp.cz - Základní škola Červené Pečky
id) { // dibi::test ("select day(article_date) as day, month(article_date) as month, title, short_text from article where parent_id=%i and label_id & %i and article_date>=now() and state=%i and deletedby=%i order by article_date limit 1", $mpID->id, 2, 1, 0); $dataRow=dibi::fetch("select day(article_date) as day, month(article_date) as month, title, short_text from article where parent_id=%i and label_id & %i and article_date>=%s and state=%i and deletedby=%i order by article_date limit 1", $mpID->id, 2, date("Y-m-d"), 1, 0); } ?>

Fotogalerie


id) { // dibi::test ("select id, article_date, title, short_text from article where site_id=%i and label & %i order by article_date desc", $mpID->id, 1); $dataRes=dibi::query("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc limit 6", $mpID->id, 8, 1, 0); if(count($dataRes)>0) { foreach($dataRes as $dataRow) { $url="/site-photo/".str_pad($dataRow->id, 4, "0", STR_PAD_LEFT); $Fid=str_pad($dataRow->id, 4, "0", STR_PAD_LEFT); echo "title\">\"$dataRow-title\" class=\"shadow\" />\n"; } // echo "

"; echo "více

"; } else echo "V této sekci není žádná fotogalerie."; } else echo "V této sekci není žádná fotogalerie."; ?>

$hrefTitle


"; if($mpID->id) { // dibi::test ("select id, article_date, title, short_text from article where site_id=%i and label & %i order by article_date desc limit 5", $mpID->id, 1); $dataRes=dibi::query("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc limit 3", $mpID->id, 1, 1, 0); if(count($dataRes)>0) { foreach($dataRes as $dataRow) { echo "

".date("j.n.Y", strtotime($dataRow->article_date))."
id\">$dataRow->title
$dataRow->short_text

"; } echo "více

"; } else echo "V této sekci není žádný článek."; } else echo "V této sekci není žádný článek."; ?>





 

id) { echo "".date("j.n.Y", strtotime($dataRow->article_date))."
\n"; echo "

$dataRow->title

\n"; if($dataRow->short_text) echo "

$dataRow->short_text

\n"; if($dataRow->text) echo "

$dataRow->text

\n"; } else echo "Požadovaná fotogalerie neexistuje."; $pg=$dataRow->id; } else { if($mpID->id) { // dibi::test ("select id, article_date, title, short_text from article where site_id=%i and label & %i order by article_date desc", $mpID->id, 1); $dataRes=dibi::query("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc", $mpID->id, 8, 1, 0); if(count($dataRes)>0) { foreach($dataRes as $dataRow) { $url="/site-photo/".str_pad($dataRow->id, 4, "0", STR_PAD_LEFT); $Fid=str_pad($dataRow->id, 4, "0", STR_PAD_LEFT); echo "title\">\"$dataRow-title\" />$dataRow->title\n"; } } else echo "Stránka neobsahuje žádné fotogalerie."; } else echo "Stránka neobsahuje žádné fotogalerie."; } break; case "zs-clanky": case "ms-clanky": case "babyklub-aktuality": case "druzina-clanky": case "anglictina-clanky": if($_GET["id"]) { $dataRow=dibi::fetch("select * from article where id=%i and state=%i and deletedby=%i", $_GET["id"], 1, 0); if($dataRow->id) { echo " ".date("j.n.Y", strtotime($dataRow->article_date))."

$dataRow->title

$dataRow->short_text

$dataRow->text

\n"; // vypis dokumentu $documentsPath="ke-stazeni/clanky/$mpID->id/$dataRow->id"; if(is_dir($documentsPath)) { $aFile=iterator_to_array(NFinder::findFiles('*')->in($documentsPath)); if(count($aFile)>0) { echo "
"; ksort($aFile); foreach ($aFile as $file) { // echo $file."
"; $url=str_replace("\\","/",$file); $name=substr($file,strrpos($file,"/")+1); $name=str_replace("-"," ",$name); $ext=substr($file,strrpos($file,".")+1); echo "\"$name\"
$name
\n"; } } } } else echo "Požadovaný článek neexistuje."; $pg=$dataRow->id; } else { if($mpID->id) { // dibi::test ("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc", $mpID->id, 1, 1, 0); $dataRes=dibi::query("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc", $mpID->id, 1, 1, 0); if(count($dataRes)>0) { foreach($dataRes as $dataRow) { $dd=date("j", strtotime($dataRow->article_date)); $mm=date("n", strtotime($dataRow->article_date)); $yy=date("Y", strtotime($dataRow->article_date)); echo "
".(strlen($dd)<2?" $dd":"$dd").".
".(strlen($mm)<2?" $mm":"$mm").".
$yy
$dataRow->title

$dataRow->short_text

"; if($_SESSION["MAINPAGE"]=="babyklub") echo "id\" class=\"more\">více

"; else echo "id\" class=\"more\">více

"; echo "
\"div\"
\n"; } } else echo "Neexistují žádné články"; } else echo "Článek neexistuje"; } break; case "zs-akce": case "ms-akce": case "babyklub-akce": case "babyklub-vsehochut": case "druzina-akce": case "anglictina-akce": if($_GET["id"]) { $dataRow=dibi::fetch("select * from article where id=%i and state=%i and deletedby=%i", $_GET["id"], 1, 0); if($dataRow->id) { echo " ".date("j.n.Y", strtotime($dataRow->article_date))."

$dataRow->title

$dataRow->short_text

$dataRow->text

\n"; // vypis dokumentu $documentsPath="ke-stazeni/clanky/$mpID->id/$dataRow->id"; if(is_dir($documentsPath)) { $aFile=iterator_to_array(NFinder::findFiles('*')->in($documentsPath)); if(count($aFile)>0) { ksort($aFile); foreach ($aFile as $file) { // echo $file."
"; $url=str_replace("\\","/",$file); $name=substr($file,strrpos($file,"/")+1); $name=str_replace("-"," ",$name); $ext=substr($file,strrpos($file,".")+1); echo "\"$name\"
$name
\n"; } } } } else echo "Požadovaný článek neexistuje."; $pg=$dataRow->id; } else { if($mpID->id) { if($_SESSION["PAGE"]=="babyklub-vsehochut") { $label=32; $dataRes=dibi::query ("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc", $mpID->id, $label, 1, 0); } else { $label=2; $dataRes=dibi::query("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i and article_date>=now() order by article_date", $mpID->id, $label, 1, 0); } if(count($dataRes)>0) { // archiv akci echo "Archiv akcí"; foreach($dataRes as $dataRow) { if($_SESSION["PAGE"]=="babyklub-vsehochut") { $dtm=""; } else { $dd=date("j", strtotime($dataRow->article_date)); $mm=date("n", strtotime($dataRow->article_date)); $yy=date("Y", strtotime($dataRow->article_date)); $dtm="
".(strlen($dd)<2?" $dd":"$dd").".
".(strlen($mm)<2?" $mm":"$mm").".
$yy
"; } echo "
$dtm $dataRow->title

$dataRow->short_text

id\" class=\"more\">více

\"div\"
\n"; } } } else echo "Článek neexistuje"; } break; case "zs-akce-archiv": case "ms-akce-archiv": case "babyklub-akce-archiv": case "babyklub-vsehochut-archiv": case "druzina-akce-archiv": case "anglictina-akce-archiv": if($_GET["id"]) { $dataRow=dibi::fetch("select * from article where id=%i and state=%i and deletedby=%i", $_GET["id"], 1, 0); if($dataRow->id) { echo " ".date("j.n.Y", strtotime($dataRow->article_date))."

$dataRow->title

$dataRow->short_text

$dataRow->text

\n"; // vypis dokumentu $documentsPath="ke-stazeni/clanky/$mpID->id/$dataRow->id"; if(is_dir($documentsPath)) { $aFile=iterator_to_array(NFinder::findFiles('*')->in($documentsPath)); if(count($aFile)>0) { ksort($aFile); foreach ($aFile as $file) { // echo $file."
"; $url=str_replace("\\","/",$file); $name=substr($file,strrpos($file,"/")+1); $name=str_replace("-"," ",$name); $ext=substr($file,strrpos($file,".")+1); echo "\"$name\"
$name
\n"; } } } } else echo "Požadovaný článek neexistuje."; $pg=$dataRow->id; } else { if($mpID->id) { if($_SESSION["PAGE"]=="babyklub-vsehochut") { $label=32; $dataRes=dibi::query ("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc", $mpID->id, $label, 1, 0); } else { $label=2; $dataRes=dibi::query("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc", $mpID->id, $label, 1, 0); } if(count($dataRes)>0) { foreach($dataRes as $dataRow) { if($_SESSION["PAGE"]=="babyklub-vsehochut") { $dtm=""; } else { $dd=date("j", strtotime($dataRow->article_date)); $mm=date("n", strtotime($dataRow->article_date)); $yy=date("Y", strtotime($dataRow->article_date)); $dtm="
".(strlen($dd)<2?" $dd":"$dd").".
".(strlen($mm)<2?" $mm":"$mm").".
$yy
"; } echo "
$dtm $dataRow->title

$dataRow->short_text

id\" class=\"more\">více

\"div\"
\n"; } } } else echo "Článek neexistuje"; } break; case "babyklub-vsehochut": if($_GET["id"]) { $dataRow=dibi::fetch("select * from article where id=%i and state=%i and deletedby=%i", $_GET["id"], 1, 0); if($dataRow->id) { echo "

$dataRow->title


$dataRow->short_text

$dataRow->text

\n"; // vypis dokumentu $documentsPath="ke-stazeni/clanky/$mpID->id/$dataRow->id"; if(is_dir($documentsPath)) { $aFile=iterator_to_array(NFinder::findFiles('*')->in($documentsPath)); if(count($aFile)>0) { ksort($aFile); foreach ($aFile as $file) { // echo $file."
"; $url=str_replace("\\","/",$file); $name=substr($file,strrpos($file,"/")+1); $name=str_replace("-"," ",$name); $ext=substr($file,strrpos($file,".")+1); echo "\"$name\"
$name
\n"; } } else echo "Stránka neobsahuje žádné dokumenty."; } else echo "Stránka neobsahuje žádné dokumenty."; } else echo "Požadovaný článek neexistuje."; } else { if($mpID->id) { // dibi::test ("select id, article_date, title, short_text from article where site_id=%i and label & %i order by article_date desc", $mpID->id, 2); $dataRes=dibi::query("select id, article_date, title, short_text from article where parent_id=%i and label_id & %i order by article_date desc", $mpID->id, 2); if(count($dataRes)>0) { foreach($dataRes as $dataRow) { $dd=date("j", strtotime($dataRow->article_date)); $mm=date("n", strtotime($dataRow->article_date)); echo "
$dataRow->title

$dataRow->short_text

id\" class=\"more\">více

\"div\"
\n"; } } } else echo "Článek neexistuje"; } break; case "Xzs-dokumenty": case "Xms-dokumenty": case "Xdruzina-dokumenty": case "Xbabyklub-dokumenty": $documentsPath="ke-stazeni/dokumenty/$mpID->id/"; if(is_dir($documentsPath)) { $aFile=iterator_to_array(NFinder::findFiles('*')->in($documentsPath)); if(count($aFile)>0) { ksort($aFile); echo "
Název dokumentu
Datum
Stáhnout
"; foreach ($aFile as $file) { $url=str_replace("\\","/",$file); $name=substr($file,strrpos($file,"/")+12); $datum=date("j.n.Y", strtotime(substr($file,strrpos($file,"/")+1,10))); $name=str_replace("-"," ",$name); $ext=substr($file,strrpos($file,".")+1); echo "
$name
$datum
\"stažení
\n"; $d[]="insert into article (parent_id, label_id, article_date, title, state, createdby) values ('$mpID->id', '4', '".date("Y-m-d", strtotime(substr($file,strrpos($file,"/")+1,10)))."', '$name', '1', '1');"; } echo "
"; echo implode("
",$d); } else echo "Stránka neobsahuje žádné dokumenty."; } else echo "Stránka neobsahuje žádné dokumenty."; echo "
"; break; case "zs-dokumenty": case "ms-dokumenty": case "druzina-dokumenty": case "babyklub-dokumenty": // dibi::test("select * from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc", $mpID->id, 4, 1, 0); $docRes=dibi::query("select * from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc", $mpID->id, 4, 1, 0); if(count($docRes)>0) { $documentsPath="ke-stazeni/clanky/$mpID->id"; echo "
Název dokumentu
Zveřejněno
Stáhnout
"; foreach($docRes as $docRow) { $url="$documentsPath/$docRow->id/"; if(file_exists($url)) { $aFile=iterator_to_array(NFinder::findFiles('*')->in($url)); // var_dump($aFile); foreach($aFile as $file) { $url=str_replace("\\","/",$file); $dwnld="\"stažení"; } } else $dwnld=""; $datum=date("j.n.Y", strtotime($docRow->article_date)); // $dwnld="Rozbalit složku"; echo "
$docRow->title
$datum
$dwnld
\n"; } echo "
"; } else echo "Stránka neobsahuje žádné dokumenty."; echo "
"; break; case "zs-jidelna": case "ms-jidelna": $jidelnaRes=dibi::query("select * from article where parent_id=%i and label_id & %i and state=%i and deletedby=%i order by article_date desc", $mpID->id, 16, 1, 0); if(count($jidelnaRes)>0) { $documentsPath="ke-stazeni/clanky/$mpID->id"; echo "
Název dokumentu
Stáhnout
"; foreach($jidelnaRes as $jidelnaRow) { $url="$documentsPath/$jidelnaRow->id/menu.doc"; $urlPDF="$documentsPath/$jidelnaRow->id/menu.pdf"; $name=substr($file,strrpos($file,"/")+12); $datum=date("j.n.Y", strtotime(substr($file,strrpos($file,"/")+1,10))); $name=str_replace("-"," ",$name); $ext=substr($file,strrpos($file,".")+1); if(file_exists(__DIR__."/$url")) $dwnld="\"stažení"; if(file_exists(__DIR__."/$urlPDF")) $dwnld="\"stažení"; echo "
$jidelnaRow->title
$dwnld
\n"; } echo "
"; } else echo "Stránka neobsahuje žádné dokumenty."; echo "
"; break; default: if($pageRow->perex) echo $pageRow->perex."

"; echo $pageRow->text; $pg=$pageRow->id; } //foto if(is_dir(__DIR__."/site-photo/".str_pad($pg, 4, "0", STR_PAD_LEFT))) { $dirs=iterator_to_array(NFinder::findFiles('*_sml.jpg')->in('site-photo/'.str_pad($pg, 4, "0", STR_PAD_LEFT))); if(count($dirs)>0) { echo "
"; echo "

Fotogalerie

"; ksort($dirs); unset($gPath); foreach ($dirs as $fl) { $gid=(int)substr($fl, 8, 4); $fid=(int)substr($fl, strrpos($fl, "/")+1, 3); echo "\n"; } } } ?>